﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient;

namespace DAO
{
    public class UpdateDataDAO
    {
        public static Boolean UpdateBafee(string SoBn, string DVuCode
                            , Boolean Process, SqlConnection conpk, string MaDonVi)
        {
            bool ok = false;

            string sp = "usp_GPB_updatebafee ";
            sp += String.Format(" '{0}',{1},'{2}','{3}'", SoBn, DVuCode, Process, MaDonVi);
            ok = Uit.it_SQL.ExecuteNonQuery(sp, conpk);

            return ok;
        }

        public static Boolean Updatefeent(string SoBn, string SoHS, string SoNhapVien
                                    , string DVuCode, Boolean Process, SqlConnection conpk, string MaDonVi)
        {
            bool ok = false;
            string sp = "usp_GPB_updatefeent ";
            sp += String.Format(" '{0}','{1}','{2}',{3},'{4}','{5}'"
                                , SoBn, SoHS, SoNhapVien, DVuCode, Process, MaDonVi);
            ok = Uit.it_SQL.ExecuteNonQuery(sp, conpk);
            return ok;
        }

        public static Boolean UpdateProcessKSK(string SoHS,string SoBn
                            , string DVuCode, Boolean Process, SqlConnection conpk, string MaDonVi)
        {
            bool ok = false;
            string sp = "usp_GPB_updateBafeeKSK ";
            sp += String.Format(" '{0}','{1}','{2}','{3}','{4}'"
                                , SoHS, SoBn, DVuCode, Process, MaDonVi);
            ok = Uit.it_SQL.ExecuteNonQuery(sp, conpk);
            return ok;
        }

        public static Boolean UpdateMienGiam(string SoBn, string DVuCode
                        , Boolean Process, SqlConnection conpk, string MaDonVi)
        {
            bool ok = false;
            string sp = "usp_GPB_updateBafeeMG ";
            sp += String.Format(" '{0}','{1}','{2}','{3}'"
                                , SoBn, DVuCode, Process, MaDonVi);
            ok = Uit.it_SQL.ExecuteNonQuery(sp, conpk);
            return ok;
        }
    }
}
